# $Id$
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>

pkgname=bison
pkgver=3.0.4
pkgrel=3
pkgdesc="The GNU general-purpose parser generator"
arch=('i686' 'x86_64')
license=('GPL3')
url="http://www.gnu.org/software/bison/bison.html"
depends=('glibc' 'm4' 'sh')
groups=('base-devel')
source=(ftp://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.xz{,.sig} bison-test-gcc7.patch)
md5sums=('c342201de104cc9ce0a21e0ad10d4021'
         'SKIP'
         'bae75fe287a2175a817b891f038fa551')
validpgpkeys=('7DF84374B1EE1F9764BBE25D0DDCAA3278D5264E')  # Akim Demaille

prepare() {
  cd $pkgname-$pkgver
  # Fix test failures with GCC 7
  patch -p1 -i ../bison-test-gcc7.patch
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}  
  ./configure --prefix=/usr --datadir=/usr/share
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
